<?php

namespace app\controller;

use think\facade\Cookie;
use think\facade\View;

class Cookies
{
    public function __construct()
    {
        $admin_id = Cookie::get('admin_id');
        if (empty($admin_id)) {
            header('location:/login');
            exit();
        }
        View::assign([//向前端传递值
           'user' => Cookie::get('admin_account')
        ]);
    }
}